<template>
  <div calss="TestStrat">
    <div>
      <van-nav-bar
        title="驾考宝典"
      />
    </div>
    <van-tabs v-model="active">

      <van-tab title="科目 一">
        <div class="pore">

          <van-circle
          v-model="currentRate"
          :rate="85"
          :speed="80"
          :text="text"
          class="ab- size"
          :color="gradientColor"
          />

          <van-button
          to="/test"
          size="large"
          class="with ab"
          round type="info"
          color="linear-gradient(to right, rgb(42, 186, 247), rgb(56, 148, 249))
          ">顺序练习</van-button>

          <van-circle
          v-model="currentRate1"
          :rate="45"
          :speed="80"
          :text="text"
          class="ab_- size"
          />

          <van-button
          to="/examination"
          size="large"
          round type="info"
          class="with ab_"
          color="linear-gradient(to right, rgb(69, 231, 191), rgb(15, 205, 178))
          ">模拟考试</van-button>
        </div>
      </van-tab>
      <van-tab title="科目 二">
        <Ersan></Ersan>
      </van-tab>
      <van-tab title="科目 三">
        <Saner></Saner>
      </van-tab>
      <van-tab title="科目 四">
        <div class="pore">

          <van-circle
          v-model="currentRate2"
          :rate="65"
          :speed="80"
          :text="text"
          class="ab- size"
          :color="gradientColor"
          />

          <van-button
          to="/test"
          size="large"
          class="with ab"
          round type="info"
          color="linear-gradient(to right, rgb(42, 186, 247), rgb(56, 148, 249))
          ">顺序练习</van-button>

          <van-circle
          v-model="currentRate3"
          :rate="35"
          :speed="80"
          :text="text"
          class="ab_- size"
          />

          <van-button
          to="/examination"
          size="large"
          round type="info"
          class="with ab_"
          color="linear-gradient(to right, rgb(69, 231, 191), rgb(15, 205, 178))
          ">模拟考试</van-button>
        </div>
      </van-tab>
    </van-tabs>

    <div class="gg" v-if="show">
      <van-icon name="cross" class="icon" @click="btncenl"/>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item style="background-color: #39a9ed;">广告位1</van-swipe-item>
      <van-swipe-item style="background-color: pink;">广告位2</van-swipe-item>
      <van-swipe-item style="background-color: deeppink;">广告位3</van-swipe-item>
      <van-swipe-item style="background-color: skyblue;">广告位4</van-swipe-item>
    </van-swipe>
    </div>
  </div>
</template>

<script>
import Ersan from './component/ersan.vue'
import Saner from './component/saner.vue'
export default {
  components: {
    Saner,
    Ersan
  },
  name: 'SafeIndex',
  methods: {
    btncenl () {
      this.show = false
    }
  },
  computed: {
    text () {
      return this.currentRate.toFixed(0) + '%'
    }
  },
  data () {
    return {
      show: true,
      active: 0,
      currentRate: 0,
      currentRate1: 0,
      currentRate2: 0,
      currentRate3: 0,
      gradientColor: {
        '0%': '#3fecff',
        '100%': '#6149f6'
      }
    }
  }
}
</script>

<style scoped lang="less">

.van-nav-bar__content{
  .van-ellipsis {
    font-size: 36px;
  }
}
.with {
  width: 200px;
  height: 200px;
}
.pore {
  position: relative;
  width: 100%;
  height: 500px;
  top: 100%;
}
.ab {
  position: absolute;
  top: 13%;
  left: 37%;
}
.ab- {
  position: absolute;
  top: 10%;
  left: 30.5%;
}

.ab_ {
  position: absolute;
  top: 450px;
  left: 37%;
}
.ab_- {
  position: absolute;
  top: 450 - 15px;
  left: 30.5%;
}
.size {
  width: 300px;
  height: 230px;
}
.my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
  }
.gg {
  position: fixed;
  bottom: 30px;
  background-color: #ccc;
  width: 100%;
  height: 200px;
  .icon {
  display: inline-block;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 9;
  font-size: 25px;
  }
}
</style>
